#ifndef __LS_DC357_COMMON_H__
#define __LS_DC357_COMMON_H__


#define TX_MAGIC                0xAABB

#define RX_MAGIC                0xAACC

/*
	SPI传输，有效负载的最大长度，单位字节
*/
#define SPI_BUF_PKG_MAX_LEN     1024


/*
	SPI通道配置
*/
typedef enum{
 P2P_CHANNEL_CMD,   //和客户端的指令通道
 P2P_CHANNEL_VIDEO, //视频数据通道
 P2P_CHANNEL_SETUP, //设置 WIFI 参数和返回 WIFI 状态通道
 P2P_CHANNEL_SOUND, //声音数据通道
 }enP2P_CHANNEL;



/*
	M4和WIFI之间的自定义命令的定义
*/
typedef enum{
    CMD_WIFI_TO_M4_P2P_CLIENT_CONNECT,
	CMD_WIFI_TO_M4_P2P_CLIENT_CLOSE,
    CMD_M4_WIFI_DEV_INFO,
    CMD_M4_TO_WIFI_ALARM,
    CMD_M4_WIFI_CHECK_UPDATE,
    CMD_M4_TO_WIFI_P2P_CLOSE,       //通知WIFI关闭P2P连接
    CMD_M4_TO_WIFI_WIFIID,          //M4将识别的配网二维码字符串发给WIFI
	CMD_WIFI_TO_M4_P2P_WIFI_CONNECT,//KW 通知412 WIFI已经连接
    CMD_WIFI_TO_M4_PRESSKEY,
    CMD_M4_TO_WIFI_FILE,            //文件
    CMD_M4_TO_WIFI_SLEEP,
    CMD_MAX
}enCmd_type;


#pragma pack(1)

/*
	SPI传输包
*/
typedef struct {
    unsigned int  channel;
    unsigned int  magic;
    unsigned int  len;
    unsigned char buf[SPI_BUF_PKG_MAX_LEN];
}Trans_pkg;



/// @brief  P2P_CHANNEL_SETUP
typedef struct {
 unsigned int  cmd_type; //填写下面 enCmd_type 的命令集 07 
 unsigned int  cmd_len; //多数固定为 4
 unsigned char buf[0];   
}stCmd_head;


// cmd 
typedef struct {
    stCmd_head head;
	struct 
    {
        int session_id;
    }body;
}CMD_CLIENT_CLOSE_WIFI_TO_M4_S,
CMD_CLIENT_CONENCT_WIFI_TO_M4_S,
CMD_CLIENT_STATUS_WIFI_TO_M4_S;




#pragma pack(0)

#endif
